<!--
 * @Author       : wfl
 * @LastEditors: ww
 * @description  :
 * @updateInfo   :
 * @Date         : 2023-05-10 10:58:02
 * @LastEditTime: 2023-06-28 10:29:15
-->
<script setup lang="ts" name="IApproved">
import type { Component } from 'vue'
const props = defineProps({
  innerName: {
    type: String,
    default: EApprovedType.待审列表
  }
})

const ApproveTable: Component = defineAsyncComponent(
  () => import('./ApprovalTable.vue')
)

const activeTab = ref(props.innerName)
provide('activeTab', activeTab)
const refApproveTable = ref()
defineExpose({
  refApproveTable
})

const tabList = [{ label: '待审列表', value: EApprovedType.待审列表 }, { label: '已审列表', value: EApprovedType.已审列表 }]
</script>

<template>
  <div>
    <div class="tab-approve">
      <IkRadioGroup v-model="activeTab" :list="tabList" />
    </div>
    <transition name="fade">
      <ApproveTable
        ref="refApproveTable"
        :tab="`${activeTab}i-approved`"
        no-title
      />
    </transition>
  </div>
</template>

<style lang="scss">
.tab-approve {
  z-index: 2;
  position: absolute;
  left: 15px;
  top: 18px;
}
</style>
